<?php

$url = "http://openapi.tuling123.com/openapi/api/v2";

$data =[
	'reqType'=>0,
	'perception'=>[
		'inputText'=>
		['text'=>$_GET['w']]
	],
	'userInfo'=>[
		'apiKey'=>'facc47b9f3afc7a493121bf6aacab53f68767867',
		'userId'=>3423
	]
];


$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");//post
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));//post 数据 
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Content-Length: ' . strlen(json_encode($data))
));
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false);

$data = curl_exec($curl);

var_dump($data);

var_dump(json_decode($data,true)['results']);
